<?php
/**
 * Created by Command.
 * User: Vito
 */

declare (strict_types = 1);

namespace app\model;

class PollingRecord extends BaseModel
{
    const STATE_NO = 0;
    const STATE_YES  = 1;

    protected $stateEnum = [
        self::STATE_NO => '未巡检',
        self::STATE_YES  => '已巡检',
    ];

    public function repairUser(){
        return $this->belongsTo('repair_user','user_id');
    }

    /**
     * @Description: 获取巡检记录
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-04 15:59:23
     * @version: 1.0.0
     * @return [type]
     */    
    public static function getPollingRecord($where){

        return self::where($where)->find();
    }
}
